import config from "@/config"
import http from "@/utils/request"

export default {
  putNewWorkData: {
    url: `${config.API_URL}/ms/cms/short/updateNewReleases/`,
    name: "更新新作排序",
    put: async function(id, params){
      return await http.put(this.url + id, params,{
				headers: {
					'Content-Type': 'multipart/form-data'
				}
			})
    }
  },
  putHotWorkData: {
    url: `${config.API_URL}/ms/cms/short/updatePopRecSort/`,
    name: "更新人气推荐排序",
    put: async function(id, params){
      return await http.put(this.url + id, params,{
				headers: {
					'Content-Type': 'multipart/form-data'
				}
			})
    }
  },
  getHotShortsList: {
    url: `${config.API_URL}/ms/cms/short/list/popularRecommendation`,
    name: "获取热门推荐列表",
    get: async function(params){
      return await http.get(this.url, params)
    }
  },
  postPopRecSort: {
    url: `${config.API_URL}/ms/cms/short/savePopRecSort`,
    name: "保存热门推荐排序",
    post: async function(data){
      return await http.post(this.url, data)
    }
  },
  getPopularRecommendations: {
    url: `${config.API_URL}/ms/cms/short/list/getPopularRecommendations`,
    name: "获取全部short针对热门推荐",
    get: async function(params){
      return await http.get(this.url, params)
    }
  },
  putPlayCount: {
    url: `${config.API_URL}/ms/cms/short/updatePlayCount/`,
    name: "更新播放量",
    put: async function(id, params){
      return await http.put(this.url+id, params,{
				headers: {
					'Content-Type': 'multipart/form-data'
				}
			})
    }
  },
  fetchTagsList: {
    url: `${config.API_URL}/ms/cms/short/list/tag`,
    name: "获取tags分类列表",
    get: async function(params){
      return await http.get(this.url, params)
    }
  },
  fetchMovTypeList: {
    url: `${config.API_URL}/ms/cms/short/list/movieGenre`,
    name: "获取影片类型列表",
    get: async function(params){
      return await http.get(this.url, params)
    }
  },
  fetchAreaList: {
    url: `${config.API_URL}/ms/cms/short/list/production`,
    name: "获取地区列表",
    get: async function(params){
      return await http.get(this.url, params)
    }
  },
  getShortsList: {
    url: `${config.API_URL}/ms/cms/short/list`,
    name: "获取shorts列表",
    get: async function(params){
      return await http.get(this.url,params)
    }
  },
  getFileId: {
    url: `${config.API_URL}/ms/api/cms/file/`,
    name: "获取fileId",
    get: async function(params){
      return await http.get(this.url+params)
    }
  },
  getVideoFileId: {
    url: `${config.API_URL}/ms/cms/short/mp?key=`,
    name: "获取video fileId",
    get: async function(params){
      return await http.get(this.url+params)
    }
  },
  getShortsDraftList: {
    url: `${config.API_URL}/ms/cms/short/draft/list`,
    name: "获取shorts草稿列表",
    get: async function(params){
      return await http.get(this.url,params)
    }
  },
  shortDetail: {
    url: `${config.API_URL}/ms/cms/short/info/`,
    name: "获取short详情",
    get: async function(params){
      return await http.get(this.url+params)
    }
  },
  draftDetail: {
    url: `${config.API_URL}/ms/cms/short/draft/info/`,
    name: "获取short 草稿详情",
    get: async function(params){
      return await http.get(this.url+params)
    }
  },
  saveDraftUpload: {
    url: `${config.API_URL}/ms/cms/short/temp/save`,
    name: "保存草稿",
    post: async function(data = {}){
      return await http.post(this.url,data)
    }
  },
  publishVideo: {
    url: `${config.API_URL}/ms/cms/short/release/`,
    name: "上架视频剧集",
    get: async function(params){
      return await http.get(this.url+params)
    }
  },
  shortCreate: {
    url: `${config.API_URL}/ms/cms/short/save`,
    name: "修改short",
    post: async function(data = {}){
      return await http.post(this.url,data)
    }
  },
  delDraftShort: {
    url: `${config.API_URL}/ms/cms/short/draft/del/`,
    name: "删除Short",
    delete: async function(params){
      return await http.delete(this.url+params)
    }
  },
  delSubtitle: {
    url: `${config.API_URL}/ms/cms/short/srt/delete/`,
    name: "删除字幕",
    delete: async function(id){
      return await http.delete(this.url + id)
    }
  },
  removeShort: {
    url: `${config.API_URL}/ms/cms/short/unpublish/`,
    name: "下架Short",
    get: async function(params){
      return await http.get(this.url+params)
    }
  },
  fetchCategory: {
    url: `${config.API_URL}/ms/cms/short/list/category`,
    name: "分类列表",
    get: async function(params) {
      return await http.get(this.url, params)
    }
  },
  
}